home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / cooles1a / form4.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1999-03-02  |  5.8 KB  |  275 lines

  1. VERSION 5.00
  2. Begin VB.Form Form2 
  3.    BorderStyle     =   4  'Fixed ToolWindow
  4.    Caption         =   "Edit Screwed Text"
  5.    ClientHeight    =   2265
  6.    ClientLeft      =   45
  7.    ClientTop       =   285
  8.    ClientWidth     =   3495
  9.    LinkTopic       =   "Form2"
  10.    MaxButton       =   0   'False
  11.    MinButton       =   0   'False
  12.    ScaleHeight     =   2265
  13.    ScaleWidth      =   3495
  14.    ShowInTaskbar   =   0   'False
  15.    StartUpPosition =   2  'CenterScreen
  16.    Begin VB.CommandButton Command1 
  17.       Caption         =   "OK"
  18.       Height          =   255
  19.       Left            =   120
  20.       TabIndex        =   5
  21.       Top             =   1320
  22.       Width           =   1215
  23.    End
  24.    Begin VB.TextBox Text2 
  25.       Height          =   285
  26.       Left            =   120
  27.       MaxLength       =   5
  28.       TabIndex        =   2
  29.       Top             =   480
  30.       Width           =   1215
  31.    End
  32.    Begin VB.CommandButton Command2 
  33.       Caption         =   "Change"
  34.       Height          =   255
  35.       Left            =   120
  36.       TabIndex        =   1
  37.       Top             =   840
  38.       Width           =   1215
  39.    End
  40.    Begin VB.ListBox List1 
  41.       Columns         =   3
  42.       Height          =   2010
  43.       Left            =   1440
  44.       TabIndex        =   0
  45.       Top             =   120
  46.       Width           =   1935
  47.    End
  48.    Begin VB.Line Line1 
  49.       X1              =   120
  50.       X2              =   1320
  51.       Y1              =   1200
  52.       Y2              =   1200
  53.    End
  54.    Begin VB.Label Label1 
  55.       Height          =   255
  56.       Left            =   120
  57.       TabIndex        =   4
  58.       Top             =   120
  59.       Width           =   615
  60.    End
  61.    Begin VB.Label Label2 
  62.       Caption         =   "to:"
  63.       Height          =   255
  64.       Left            =   840
  65.       TabIndex        =   3
  66.       Top             =   120
  67.       Width           =   495
  68.    End
  69. Attribute VB_Name = "Form2"
  70. Attribute VB_GlobalNameSpace = False
  71. Attribute VB_Creatable = False
  72. Attribute VB_PredeclaredId = True
  73. Attribute VB_Exposed = False
  74. Dim s(52) As String
  75. Dim t(52) As String
  76. Dim li As Long
  77. Public Sub Sav2()
  78. Directory$ = App.Path & "\text.dat"
  79.        Dim SaveList As Integer
  80.        On Error Resume Next
  81.        Open Directory$ For Output As #1
  82.        For SaveList = 0 To List1.ListCount - 1
  83.            Print #1, s(SaveList)
  84.        Next SaveList
  85.        Close #1
  86. End Sub
  87. Public Sub Opn2()
  88. Directory$ = App.Path & "\text.dat"
  89. If Directory$ <> "" Then
  90.     Dim MyString As String
  91.     Dim c As Long
  92.     Dim i As Integer
  93.     c = 0
  94.        On Error Resume Next
  95.        Open Directory$ For Input As #1
  96.        While Not EOF(1)
  97.            Input #1, MyString$
  98.            DoEvents
  99.                s(c) = MyString$
  100.                a = 1
  101.                c = c + 1
  102.            Wend
  103.            Close #1
  104. List1.Clear
  105. For i = 0 To c - 1
  106. List1.AddItem s(i)
  107. Next i
  108. End If
  109. End Sub
  110. Function sReplaceCharacters(strMainString As String, strOld As String, strNew As String) As String
  111.     sReplaceCharacters = ""
  112.     Dim strNewString As String
  113.     Dim i As Integer
  114.     For i = 1 To Len(strMainString)
  115.         If Mid(strMainString, i, Len(strOld)) = strOld Then
  116.             strNewString = strNewString & strNew
  117.             i = i + Len(strOld) - 1
  118.         Else
  119.         strNewString = strNewString & Mid(strMainString, i, 1)
  120.         End If
  121.     Next i
  122.     sReplaceCharacters = strNewString
  123. End Function
  124. Private Sub Command1_Click()
  125. Form2.Hide
  126. Form1.Show
  127. End Sub
  128. Private Sub Command2_Click()
  129.   li = List1.ListIndex
  130.   If List1.ListIndex > List1.ListCount - 1 Or List1.ListIndex < 0 Then Exit Sub
  131.   List1.RemoveItem li
  132.   List1.AddItem Text2.Text, li
  133.   s(li) = Text2.Text
  134.   List1.ListIndex = li
  135. Form1.a
  136. End Sub
  137. Private Sub Form_Load()
  138. Dim i As Integer
  139. t(0) = "ae"
  140. t(1) = "a"
  141. t(2) = "b"
  142. t(3) = "c"
  143. t(4) = "d"
  144. t(5) = "e"
  145. t(6) = "f"
  146. t(7) = "g"
  147. t(8) = "h"
  148. t(9) = "i"
  149. t(10) = "j"
  150. t(11) = "k"
  151. t(12) = "l"
  152. t(13) = "m"
  153. t(14) = "n"
  154. t(15) = "o"
  155. t(16) = "p"
  156. t(17) = "q"
  157. t(18) = "r"
  158. t(19) = "s"
  159. t(20) = "t"
  160. t(21) = "u"
  161. t(22) = "v"
  162. t(23) = "w"
  163. t(24) = "x"
  164. t(25) = "y"
  165. t(26) = "z"
  166. t(27) = "A"
  167. t(28) = "B"
  168. t(29) = "C"
  169. t(30) = "D"
  170. t(31) = "E"
  171. t(32) = "F"
  172. t(33) = "G"
  173. t(34) = "H"
  174. t(35) = "I"
  175. t(36) = "J"
  176. t(37) = "K"
  177. t(38) = "L"
  178. t(39) = "M"
  179. t(40) = "N"
  180. t(41) = "O"
  181. t(42) = "P"
  182. t(43) = "Q"
  183. t(44) = "R"
  184. t(45) = "S"
  185. t(46) = "T"
  186. t(47) = "U"
  187. t(48) = "V"
  188. t(49) = "W"
  189. t(50) = "X"
  190. t(51) = "Y"
  191. t(52) = "Z"
  192. s(0) = "
  193. s(1) = "
  194. s(2) = "b"
  195. s(3) = "<"
  196. s(4) = "c|"
  197. s(5) = "
  198. s(6) = "f"
  199. s(7) = "9"
  200. s(8) = "h"
  201. s(9) = "
  202. s(10) = "j"
  203. s(11) = "|<"
  204. s(12) = "|_"
  205. s(13) = "/x\"
  206. s(14) = "|\|"
  207. s(15) = "0"
  208. s(16) = "p"
  209. s(17) = "q"
  210. s(18) = "r"
  211. s(19) = "_/
  212. s(20) = "-|-"
  213. s(21) = "
  214. s(22) = "\/"
  215. s(23) = "\/\/"
  216. s(24) = "
  217. s(25) = "
  218. s(26) = "
  219. s(27) = "
  220. s(28) = "
  221. s(29) = "
  222. s(30) = "|}"
  223. s(31) = "
  224. s(32) = "F"
  225. s(33) = "G"
  226. s(34) = "|-|"
  227. s(35) = "I"
  228. s(36) = "J"
  229. s(37) = "]<"
  230. s(38) = "]_"
  231. s(39) = "/\/\"
  232. s(40) = "|\|"
  233. s(41) = "{}"
  234. s(42) = "P"
  235. s(43) = "
  236. s(44) = "|2"
  237. s(45) = "
  238. s(46) = "
  239. s(47) = "|_|"
  240. s(48) = "\/"
  241. s(49) = "\x/"
  242. s(50) = "><"
  243. s(51) = "
  244. s(52) = "
  245. For i = 0 To 52
  246. List1.AddItem s(i)
  247. Next i
  248. List1.ListIndex = 0
  249. End Sub
  250. Private Sub Form_Terminate()
  251. End Sub
  252. Private Sub Form_Unload(Cancel As Integer)
  253. End Sub
  254. Private Sub List1_Click()
  255. If List1.ListIndex < 0 Then
  256. Exit Sub
  257. Text2.Text = List1.Text
  258. Label1.Caption = t(List1.ListIndex)
  259. End If
  260. End Sub
  261. Private Sub List1_GotFocus()
  262. If List1.ListIndex < 0 Then
  263. Exit Sub
  264. Text2.Text = List1.Text
  265. Label1.Caption = t(List1.ListIndex)
  266. End If
  267. End Sub
  268. Private Sub List1_KeyDown(KeyCode As Integer, Shift As Integer)
  269. If List1.ListIndex < 0 Then
  270. Exit Sub
  271. Text2.Text = List1.Text
  272. Label1.Caption = t(List1.ListIndex)
  273. End If
  274. End Sub
  275.